#include<iostream>
#include<opencv2/opencv.hpp>
#include<vector>
#include "./PNP_Slove.hpp"
#ifndef DETECTOR_H
#define DETECTOR_H
class Detector
{
public:

	//Detector();


	cv::Mat PorcessImage(cv::Mat img);

	std::vector<std::vector<cv::Point2f>> GetTriangles(cv::Mat binary_img);

	bool isRightIsoscelesTriangle(std::vector<cv::Point2f> &triangle, double AreaHull, double AreaTriangle);
	double calculateAngle(const cv::Point2f& pt1, const cv::Point2f& pt2, const cv::Point2f& pt3);
	bool isPointInsideImage(const cv::Point2f& pt, const cv::Mat& image);
	bool select_final_targets(std::vector<cv::Point2f>& t);
	void DrawImage(cv::Mat& img);




	std::vector<cv::Point2f> targets_;
	std::vector<std::vector<cv::Point2f>> triangles;


	double max_angle=130 , min_angle=65;
	double min_side_ratio = 0.6;
	double max_Pythagorean_diff = 2000;
	double min_Area_hull_traingle_ratio = 0.7;
	double max_AreaHull=8000, min_AreaHull=300;
	double min_point_hull_ratio = 0.5;
	double min_hull_size = 5;
	double min_Area_rect_ratio = 0.1;


};
#endif
